<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>homework5</title>
</head>
<body>
<pre>
    from functools import wraps

class AuthClass:
    def __init__(self,name,pwd):
        self.name = name
        self.pwd = pwd

    def auth(self):
        if self.name == 'python' and self.pwd == '123':
            return True
        else:
            return False

class User(AuthClass):
    def __init__(self,name,pwd):
        super().__init__(name,pwd)


def ExecuteAuth(function):
    @wraps(function)
    def auth(*args,**kwargs):
        user = User('python','123')
        if not user.auth():
            print("认证失败")
            return False
        else:
            return function(*args,**kwargs)
    return auth

@ExecuteAuth
def fun():
    print("认证成功")

fun()
</pre>
</body>
</html>